import mockjs from 'mockjs';
import { delay } from 'roadhog-api-doc';
import defaultSettings from '../src/defaultSettings';

const proxy = {
  'POST /portal/TempletController/getTempletModule.do': (req, res) => {
    res.status(200).send({
      id: 68045,
      templetName: '管思坤-一线营销-PC卡片',
      layoutType: 3,
      sysPostId: 92550,
      sysUserId: 1,
      moduleRels: [
        {
          id: 714777,
          moduleId: 11721174,
          templetId: 68045,
          sysUserId: 1,
          sysPostId: 92550,
          relType: '2',
          terminalType: '1000',
          confType: '1',
          layoutCol: '1',
          moduleIndex: 0,
          module: {
            id: 11721174,
            moduleName: '系统公告-68045',
            moduleType: '1',
            moduleLevel: 1,
            details: [
              {
                id: 11750994,
                moduleId: 11721174,
                moduleIndex: 0,
                funcMenu: {
                  id: 276109,
                  menuId: 276109,
                  menuName: '系统公告',
                  menuType: '1100',
                  menuLevel: -1,
                  menuIndex: 7,
                  parMenuId: 276103,
                  menuDesc: '公告',
                  urlAddr: '[portlet]Bulletin',
                  x: 0,
                  y: 0,
                  w: 24,
                  h: 1.35,
                  minW: 12,
                  maxW: 24,
                  minH: 1.35,
                  maxH: 1.35,
                  sysCode: '727001',
                  firstLetter: 'XTGG',
                  iconUrl: 'icon-gene-man-manager',
                  paramEncryptType: '1000',
                  menuOpenMode: '1',
                  menuCode: 'TYMH_MENU_001',
                  ifMainName: '',
                  menuTypeName: '叶子菜单',
                },
                moduleDetailId: 11750994,
              },
            ],
            moduleId: 11721174,
          },
          templetModuleRelId: 714777,
        },
        {
          id: 714689,
          moduleId: 11721421,
          templetId: 68043,
          sysPostId: 92548,
          relType: '1',
          terminalType: '1000',
          confType: '1',
          layoutCol: '1',
          moduleIndex: 1,
          module: {
            id: 11721421,
            moduleName: '关键指标',
            moduleType: '1',
            moduleLevel: 1,
            details: [
              {
                id: 11751241,
                moduleId: 11721421,
                moduleIndex: 0,
                funcMenu: {
                  id: 2769844,
                  menuId: 2769844,
                  menuName: '关键指标',
                  menuType: '1100',
                  menuLevel: -1,
                  menuIndex: 129,
                  parMenuId: 276103,
                  menuDesc: '关键指标',
                  urlAddr: '[portlet]KeyIndex',
                  x: 0,
                  y: 1.35,
                  w: 16,
                  h: 2.16,
                  minW: 12,
                  maxW: 24,
                  minH: 2.16,
                  maxH: 2.16,
                  sysCode: '727001',
                  firstLetter: 'GJZB',
                  iconUrl: 'icon-gene-man-manager',
                  paramEncryptType: '1000',
                  menuOpenMode: '1',
                  menuCode: 'TYMH_MENU_0100',
                  ifMainName: '',
                  menuTypeName: '叶子菜单',
                },
                moduleDetailId: 11751241,
              },
            ],
            moduleId: 11721421,
          },
          templetModuleRelId: 714689,
        },
        {
          id: 714778,
          moduleId: 11721175,
          templetId: 68045,
          sysUserId: 1,
          sysPostId: 92550,
          relType: '2',
          terminalType: '1000',
          confType: '1',
          layoutCol: '1',
          moduleIndex: 1,
          module: {
            id: 11721175,
            moduleName: '待办-68045',
            moduleType: '1',
            moduleLevel: 1,
            details: [
              {
                id: 11750995,
                moduleId: 11721175,
                moduleIndex: 0,
                funcMenu: {
                  id: 276108,
                  menuId: 276108,
                  menuName: '待办',
                  menuType: '1100',
                  menuLevel: -1,
                  menuIndex: 9,
                  parMenuId: 276103,
                  menuDesc: '待办',
                  urlAddr: '[portlet]Undo',
                  x: 16,
                  y: 1.35,
                  w: 8,
                  h: 2.16,
                  minW: 8,
                  maxW: 24,
                  minH: 2.16,
                  maxH: 2.16,
                  sysCode: '727001',
                  firstLetter: 'DB',
                  iconUrl: 'icon-gene-redpacket',
                  paramEncryptType: '1000',
                  menuOpenMode: '1',
                  menuCode: 'TYMH_MENU_005',
                  ifMainName: '',
                  menuTypeName: '叶子菜单',
                },
                moduleDetailId: 11750995,
              },
            ],
            moduleId: 11721175,
          },
          templetModuleRelId: 714778,
        },
        {
          id: 7147781,
          moduleId: 117211751,
          templetId: 68045,
          sysUserId: 1,
          sysPostId: 92550,
          relType: '2',
          terminalType: '1000',
          confType: '1',
          layoutCol: '1',
          moduleIndex: 1,
          module: {
            id: 117211751,
            moduleName: '增长趋势',
            moduleType: '1',
            moduleLevel: 1,
            details: [
              {
                id: 11750995,
                moduleId: 117211751,
                moduleIndex: 0,
                funcMenu: {
                  id: 27610822,
                  menuId: 27610822,
                  menuName: '增长趋势',
                  menuType: '1100',
                  menuLevel: -1,
                  menuIndex: 9,
                  parMenuId: 276103,
                  menuDesc: '增长趋势',
                  urlAddr: '[portlet]GrowthRate',
                  x: 0,
                  y: 3.51,
                  w: 24,
                  h: 3.64,
                  minW: 12,
                  maxW: 24,
                  minH: 3.64,
                  maxH: 3.64,
                  sysCode: '727001',
                  firstLetter: 'DB',
                  iconUrl: 'icon-gene-redpacket',
                  paramEncryptType: '1000',
                  menuOpenMode: '1',
                  menuCode: 'TYMH_MENU_005',
                  ifMainName: '',
                  menuTypeName: '叶子菜单',
                },
                moduleDetailId: 11750995,
              },
            ],
            moduleId: 117211751,
          },
          templetModuleRelId: 7147781,
        },
        {
          id: 714780,
          moduleId: 11721449,
          templetId: 68045,
          sysUserId: 1,
          sysPostId: 92550,
          relType: '2',
          terminalType: '1000',
          confType: '1',
          layoutCol: '1',
          moduleIndex: 3,
          module: {
            id: 11721449,
            moduleName: '客户状态分布',
            moduleType: '1',
            moduleLevel: 1,
            details: [
              {
                id: 11751269,
                moduleId: 11721449,
                moduleIndex: 0,
                funcMenu: {
                  id: 2770201,
                  menuId: 2770201,
                  menuName: '客户状态分布',
                  menuType: '1100',
                  menuLevel: -1,
                  menuIndex: 137,
                  parMenuId: 276103,
                  menuDesc: '客户状态分布',
                  urlAddr: '[portlet]CustomerDistribution',
                  x: 0,
                  y: 7.15,
                  w: 12,
                  h: 3.7,
                  minW: 8,
                  maxW: 24,
                  minH: 3.7,
                  maxH: 3.7,
                  sysCode: '727001',
                  firstLetter: 'RWGS',
                  iconUrl: 'icon-gene-man-manager',
                  paramEncryptType: '1000',
                  menuOpenMode: '1',
                  menuCode: 'TYMH_MENU_0109',
                  ifMainName: '',
                  menuTypeName: '叶子菜单',
                },
                moduleDetailId: 11751269,
              },
            ],
            moduleId: 11721449,
          },
          templetModuleRelId: 714780,
        },
        {
          id: 714780,
          moduleId: 117214491,
          templetId: 68045,
          sysUserId: 1,
          sysPostId: 92550,
          relType: '2',
          terminalType: '1000',
          confType: '1',
          layoutCol: '1',
          moduleIndex: 3,
          module: {
            id: 117214491,
            moduleName: '商机状态分布',
            moduleType: '1',
            moduleLevel: 1,
            details: [
              {
                id: 11751269,
                moduleId: 117214491,
                moduleIndex: 0,
                funcMenu: {
                  id: 2770202,
                  menuId: 2770202,
                  menuName: '商机状态分布',
                  menuType: '1100',
                  menuLevel: -1,
                  menuIndex: 137,
                  parMenuId: 276103,
                  menuDesc: '商机状态分布',
                  urlAddr: '[portlet]BusinessDistribution',
                  x: 12,
                  y: 7.15,
                  w: 12,
                  h: 3.7,
                  minW: 8,
                  maxW: 24,
                  minH: 3.7,
                  maxH: 3.7,
                  sysCode: '727001',
                  firstLetter: 'RWGS',
                  iconUrl: 'icon-gene-man-manager',
                  paramEncryptType: '1000',
                  menuOpenMode: '1',
                  menuCode: 'TYMH_MENU_0109',
                  ifMainName: '',
                  menuTypeName: '叶子菜单',
                },
                moduleDetailId: 11751269,
              },
            ],
            moduleId: 117214491,
          },
          templetModuleRelId: 714780,
        },
      ],
      terminalType: '1000',
      confType: '1',
      templetId: 68045,
    });
  },
  'GET /portal/ModuleController/getPostModuleAndRel.do': (req, res) => {
    res.status(200).send({
      modules: [
        {
          id: 11721174,
          moduleName: '系统公告-68045',
          moduleType: '1',
          moduleLevel: 1,
          details: [
            {
              id: 11750994,
              moduleId: 11721174,
              moduleIndex: 0,
              funcMenu: {
                id: 276109,
                menuId: 276109,
                menuName: '系统公告',
                menuType: '1100',
                menuLevel: -1,
                menuIndex: 7,
                parMenuId: 276103,
                menuDesc: '公告',
                urlAddr: '[portlet]Bulletin',
                x: 0,
                y: 0,
                w: 24,
                h: 1.35,
                minW: 12,
                maxW: 24,
                minH: 1.35,
                maxH: 1.35,
                sysCode: '727001',
                firstLetter: 'XTGG',
                iconUrl: 'icon-gene-man-manager',
                paramEncryptType: '1000',
                menuOpenMode: '1',
                menuCode: 'TYMH_MENU_001',
                ifMainName: '',
                menuTypeName: '叶子菜单',
              },
              moduleDetailId: 11750994,
            },
          ],
          moduleId: 11721174,
        },
        {
          id: 11721421,
          moduleName: '关键指标',
          moduleType: '1',
          moduleLevel: 1,
          details: [
            {
              id: 11751241,
              moduleId: 11721421,
              moduleIndex: 0,
              funcMenu: {
                id: 2769844,
                menuId: 2769844,
                menuName: '关键指标',
                menuType: '1100',
                menuLevel: -1,
                menuIndex: 129,
                parMenuId: 276103,
                menuDesc: '关键指标',
                urlAddr: '[portlet]KeyIndex',
                x: 0,
                y: 1.35,
                w: 16,
                h: 2.16,
                minW: 12,
                maxW: 24,
                minH: 2.16,
                maxH: 2.16,
                sysCode: '727001',
                firstLetter: 'GJZB',
                iconUrl: 'icon-gene-man-manager',
                paramEncryptType: '1000',
                menuOpenMode: '1',
                menuCode: 'TYMH_MENU_0100',
                ifMainName: '',
                menuTypeName: '叶子菜单',
              },
              moduleDetailId: 11751241,
            },
          ],
          moduleId: 11721421,
        },
        {
          id: 11721175,
          moduleName: '待办-68045',
          moduleType: '1',
          moduleLevel: 1,
          details: [
            {
              id: 11750995,
              moduleId: 11721175,
              moduleIndex: 0,
              funcMenu: {
                id: 276108,
                menuId: 276108,
                menuName: '待办',
                menuType: '1100',
                menuLevel: -1,
                menuIndex: 9,
                parMenuId: 276103,
                menuDesc: '待办',
                urlAddr: '[portlet]Undo',
                x: 16,
                y: 1.35,
                w: 8,
                h: 2.16,
                minW: 8,
                maxW: 24,
                minH: 2.16,
                maxH: 2.16,
                sysCode: '727001',
                firstLetter: 'DB',
                iconUrl: 'icon-gene-redpacket',
                paramEncryptType: '1000',
                menuOpenMode: '1',
                menuCode: 'TYMH_MENU_005',
                ifMainName: '',
                menuTypeName: '叶子菜单',
              },
              moduleDetailId: 11750995,
            },
          ],
          moduleId: 11721175,
        },
        {
          id: 117211751,
          moduleName: '增长趋势',
          moduleType: '1',
          moduleLevel: 1,
          details: [
            {
              id: 11750995,
              moduleId: 117211751,
              moduleIndex: 0,
              funcMenu: {
                id: 27610822,
                menuId: 27610822,
                menuName: '增长趋势',
                menuType: '1100',
                menuLevel: -1,
                menuIndex: 9,
                parMenuId: 276103,
                menuDesc: '增长趋势',
                urlAddr: '[portlet]GrowthRate',
                x: 0,
                y: 3.51,
                w: 24,
                h: 3.64,
                minW: 12,
                maxW: 24,
                minH: 3.64,
                maxH: 3.64,
                sysCode: '727001',
                firstLetter: 'DB',
                iconUrl: 'icon-gene-redpacket',
                paramEncryptType: '1000',
                menuOpenMode: '1',
                menuCode: 'TYMH_MENU_005',
                ifMainName: '',
                menuTypeName: '叶子菜单',
              },
              moduleDetailId: 11750995,
            },
          ],
          moduleId: 117211751,
        },
        {
          id: 11721449,
          moduleName: '客户状态分布',
          moduleType: '1',
          moduleLevel: 1,
          details: [
            {
              id: 11751269,
              moduleId: 11721449,
              moduleIndex: 0,
              funcMenu: {
                id: 2770201,
                menuId: 2770201,
                menuName: '客户状态分布',
                menuType: '1100',
                menuLevel: -1,
                menuIndex: 137,
                parMenuId: 276103,
                menuDesc: '客户状态分布',
                urlAddr: '[portlet]CustomerDistribution',
                x: 0,
                y: 7.15,
                w: 12,
                h: 3.7,
                minW: 8,
                maxW: 24,
                minH: 3.7,
                maxH: 3.7,
                sysCode: '727001',
                firstLetter: 'RWGS',
                iconUrl: 'icon-gene-man-manager',
                paramEncryptType: '1000',
                menuOpenMode: '1',
                menuCode: 'TYMH_MENU_0109',
                ifMainName: '',
                menuTypeName: '叶子菜单',
              },
              moduleDetailId: 11751269,
            },
          ],
          moduleId: 11721449,
        },
        {
          id: 117214491,
          moduleName: '商机状态分布',
          moduleType: '1',
          moduleLevel: 1,
          details: [
            {
              id: 11751269,
              moduleId: 117214491,
              moduleIndex: 0,
              funcMenu: {
                id: 2770202,
                menuId: 2770202,
                menuName: '商机状态分布',
                menuType: '1100',
                menuLevel: -1,
                menuIndex: 137,
                parMenuId: 276103,
                menuDesc: '商机状态分布',
                urlAddr: '[portlet]BusinessDistribution',
                x: 12,
                y: 7.15,
                w: 12,
                h: 3.7,
                minW: 8,
                maxW: 24,
                minH: 3.7,
                maxH: 3.7,
                sysCode: '727001',
                firstLetter: 'RWGS',
                iconUrl: 'icon-gene-man-manager',
                paramEncryptType: '1000',
                menuOpenMode: '1',
                menuCode: 'TYMH_MENU_0109',
                ifMainName: '',
                menuTypeName: '叶子菜单',
              },
              moduleDetailId: 117512691,
            },
          ],
          moduleId: 117214491,
        },
      ],
      templetModuleRels: [],
    });
  },
};

export default delay(proxy, defaultSettings.delay);
